<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0,viewport-fit=cover"><title>vim | 学习笔记</title><meta name="author" content="lzoxun"><meta name="copyright" content="lzoxun"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="基础操作模式1234567891011121314151617-   &#96;V|v&#96; 视觉选择模式    -   多行编辑        -   &#96;ctrl+v&#96;        -   &#96;选择要操作行&#96;的第一格        -   停留在&#96;最后一行&#96;，输入&#96;大写I&#96; 进入&#96;插入模式&#96;并更改        -   &#96;esc&#96;    -   &#96;i&#96; （inner）字符        -   &#96;viw&#96;:">
<meta property="og:type" content="article">
<meta property="og:title" content="vim">
<meta property="og:url" content="http://example.com/2023/07/22/linux/linux-vim/index.html">
<meta property="og:site_name" content="学习笔记">
<meta property="og:description" content="基础操作模式1234567891011121314151617-   &#96;V|v&#96; 视觉选择模式    -   多行编辑        -   &#96;ctrl+v&#96;        -   &#96;选择要操作行&#96;的第一格        -   停留在&#96;最后一行&#96;，输入&#96;大写I&#96; 进入&#96;插入模式&#96;并更改        -   &#96;esc&#96;    -   &#96;i&#96; （inner）字符        -   &#96;viw&#96;:">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png">
<meta property="article:published_time" content="2023-07-22T07:14:09.681Z">
<meta property="article:modified_time" content="2023-07-22T07:14:09.681Z">
<meta property="article:author" content="lzoxun">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png"><link rel="shortcut icon" href="/img/favicon.png"><link rel="canonical" href="http://example.com/2023/07/22/linux/linux-vim/index.html"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox/fancybox.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = {
  root: '/',
  algolia: undefined,
  localSearch: {"path":"/search.xml","preload":true,"top_n_per_article":1,"unescape":true,"languages":{"hits_empty":"找不到您查询的内容：${query}","hits_stats":"共找到 ${hits} 篇文章"}},
  translate: {"defaultEncoding":2,"translateDelay":0,"msgToTraditionalChinese":"繁","msgToSimplifiedChinese":"簡"},
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '',
  dateSuffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: {"chs_to_cht":"你已切换为繁体","cht_to_chs":"你已切换为简体","day_to_night":"你已切换为深色模式","night_to_day":"你已切换为浅色模式","bgLight":"#49b1f5","bgDark":"#1f1f1f","position":"bottom-left"},
  source: {
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: true,
  isAnchor: false,
  percent: {
    toc: true,
    rightside: false,
  },
  autoDarkmode: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: 'vim',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2023-07-22 15:14:09'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
    win.getCSS = (url,id = false) => new Promise((resolve, reject) => {
      const link = document.createElement('link')
      link.rel = 'stylesheet'
      link.href = url
      if (id) link.id = id
      link.onerror = reject
      link.onload = link.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        link.onload = link.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(link)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          const now = new Date()
          const hour = now.getHours()
          const isNight = hour <= 6 || hour >= 18
          if (t === undefined) isNight ? activateDarkMode() : activateLightMode()
          else if (t === 'light') activateLightMode()
          else activateDarkMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><meta name="generator" content="Hexo 6.3.0"></head><body><div id="loading-box"><div class="loading-left-bg"></div><div class="loading-right-bg"></div><div class="spinner-box"><div class="configure-border-1"><div class="configure-core"></div></div><div class="configure-border-2"><div class="configure-core"></div></div><div class="loading-word">加载中...</div></div></div><script>(()=>{
  const $loadingBox = document.getElementById('loading-box')
  const $body = document.body
  const preloader = {
    endLoading: () => {
      $body.style.overflow = ''
      $loadingBox.classList.add('loaded')
    },
    initLoading: () => {
      $body.style.overflow = 'hidden'
      $loadingBox.classList.remove('loaded')
    }
  }

  preloader.initLoading()
  window.addEventListener('load',() => { preloader.endLoading() })

  if (false) {
    document.addEventListener('pjax:send', () => { preloader.initLoading() })
    document.addEventListener('pjax:complete', () => { preloader.endLoading() })
  }
})()</script><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src= "" data-lazy-src="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">108</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">1</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">0</div></a></div><hr class="custom-hr"/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header"><nav id="nav"><span id="blog-info"><a href="/" title="学习笔记"><span class="site-name">学习笔记</span></a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search" href="javascript:void(0);"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div></div><div id="toggle-menu"><a class="site-page" href="javascript:void(0);"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">vim</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2023-07-22T07:14:09.681Z" title="发表于 2023-07-22 15:14:09">2023-07-22</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2023-07-22T07:14:09.681Z" title="更新于 2023-07-22 15:14:09">2023-07-22</time></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" id="" data-flag-title="vim"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"><i class="fa-solid fa-spinner fa-spin"></i></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h2 id="基础操作"><a href="#基础操作" class="headerlink" title="基础操作"></a>基础操作</h2><h3 id="模式"><a href="#模式" class="headerlink" title="模式"></a>模式</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line">-   <span class="string">`V|v`</span> 视觉选择模式</span><br><span class="line">    -   多行编辑</span><br><span class="line">        -   <span class="string">`ctrl+v`</span></span><br><span class="line">        -   <span class="string">`选择要操作行`</span>的第一格</span><br><span class="line">        -   停留在<span class="string">`最后一行`</span>，输入<span class="string">`大写I`</span> 进入<span class="string">`插入模式`</span>并更改</span><br><span class="line">        -   <span class="string">`esc`</span></span><br><span class="line">    -   <span class="string">`i`</span> （inner）字符</span><br><span class="line">        -   <span class="string">`viw`</span>:精准选择光标所在的字符</span><br><span class="line">        -   <span class="string">`vi&quot;`</span>:精准选择光标所在的双引号内的字符</span><br><span class="line">        -   拓展:<span class="string">`vi(`</span>、<span class="string">`vi[`</span>、<span class="string">`vit`</span>....:<span class="string">`t代表标题`</span></span><br><span class="line">        -   拓展:<span class="string">`di(`</span>、<span class="string">`di&quot;`</span>、<span class="string">`dit`</span>....:删除范围内的字符</span><br><span class="line">        -   <span class="string">`v&#125;`</span>:选择段落（可以与移动的符号联合起来用）</span><br><span class="line">    -   <span class="string">`a`</span> 字符</span><br><span class="line">    -   编辑模式下 <span class="title class_">Ctrl</span>+w 删除一个单词</span><br><span class="line">        与 i 一样，但是操作的对象包括符号</span><br><span class="line">    -   <span class="string">`o`</span></span><br><span class="line">    -   退出插模式 <span class="string">`esc`</span>,<span class="string">`c-c`</span>,<span class="string">`c-[`</span></span><br></pre></td></tr></table></figure>

<h3 id="移动"><a href="#移动" class="headerlink" title="移动"></a>移动</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">-   右下上左 -&gt; <span class="string">`H、J、K、L`</span>(vim-adventures.<span class="property">com</span>)</span><br><span class="line">-   页尾、首行、行尾、行头 -&gt; <span class="string">`G、gg、$、^|0`</span></span><br><span class="line">-   单词跳跃、段落跳跃 -&gt; <span class="string">`w|W、&#123;&#125;`</span></span><br><span class="line">-   跳跃一点点 -&gt; <span class="string">`gj、gk `</span></span><br><span class="line">-   <span class="string">`f|F + 字母`</span> -&gt; 从光标处跳到下一个或上一个该字母的位置</span><br><span class="line">-   定位到页面上中下 -&gt; <span class="string">`zz zt zb`</span></span><br><span class="line">-   数字 + gg -&gt; 跳到数字行</span><br><span class="line">-   <span class="string">`ctrl+b|f`</span>:上下反野</span><br><span class="line">-   <span class="string">`&#123;&#125;`</span>:段落跳跃</span><br><span class="line">-   <span class="string">`w`</span>:下一个单开头</span><br><span class="line">-   <span class="string">`b`</span>:上一个单词开头</span><br><span class="line">-   <span class="string">`e`</span>:下一个单词结尾</span><br><span class="line">-   <span class="string">`ge`</span>:上一个单词词尾</span><br></pre></td></tr></table></figure>
<h3 id="折行"><a href="#折行" class="headerlink" title="折行"></a>折行</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">-   <span class="string">`zf`</span>:zb、l 等展开</span><br><span class="line">-   <span class="string">`zfip`</span>:折叠段落</span><br></pre></td></tr></table></figure>
<h3 id="搜索"><a href="#搜索" class="headerlink" title="搜索"></a>搜索</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">-   搜索 / -&gt; <span class="string">`N|n`</span> 上下搜索 (<span class="string">`:set hlsearch`</span> 匹配高亮)</span><br><span class="line">-   直接搜索 -&gt; <span class="string">`*`</span> 搜索游标所在的词</span><br></pre></td></tr></table></figure>
<h3 id="复制、粘贴"><a href="#复制、粘贴" class="headerlink" title="复制、粘贴"></a>复制、粘贴</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">-   <span class="string">`y`</span></span><br><span class="line">    -   暂存器<span class="string">`&quot;[a-zA-Z0-9]`</span>随意使用</span><br><span class="line">    -   系统剪切板<span class="string">`&quot;+yy`</span>,<span class="string">`&quot;+p`</span></span><br><span class="line">    -   <span class="string">`&quot;ay`</span>: 将内容复制到暂存器 a 中</span><br><span class="line">    -   <span class="string">`&quot;ap`</span>: 粘贴暂存器 a 的内容</span><br><span class="line">    -   <span class="string">`:reg`</span>:查看暂存器内容</span><br><span class="line">    -   <span class="string">`:set clipboard=unnamed`</span>:与系统共享剪切板 plug</span><br><span class="line">    -   系统剪切板需要看vim 版本的clipboard前面是否为+</span><br><span class="line">-   <span class="string">`p`</span>:p 向后粘贴、P 向前粘贴</span><br></pre></td></tr></table></figure>

<h3 id="删除"><a href="#删除" class="headerlink" title="删除"></a>删除</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">-   <span class="string">`d`</span></span><br><span class="line">-   <span class="string">`c`</span>:删除并进入插入模式</span><br><span class="line">-   <span class="string">`C`</span>:删除当前位置到结尾并进入插入模式</span><br><span class="line">-   <span class="string">`x|X`</span>:直接删除游标所在字符，退格，删除光标前面的字符</span><br></pre></td></tr></table></figure>
<h3 id="替换"><a href="#替换" class="headerlink" title="替换"></a>替换</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line">-   <span class="string">`r`</span>:替换</span><br><span class="line">-   <span class="string">`~`</span>:大小写转换</span><br><span class="line">-   命令替换</span><br><span class="line">    -   <span class="string">`:[range]s/key/newkey/[option]`</span></span><br><span class="line">    -   <span class="string">`range`</span></span><br><span class="line"></span><br><span class="line">        -   <span class="string">`1,20`</span>:<span class="number">1</span> 到 <span class="number">20</span> 行</span><br><span class="line">        -   <span class="string">`%`</span>:全局</span><br><span class="line">        -   <span class="string">`1,.`</span>: 替换第一行到当前行</span><br><span class="line">        -   <span class="string">`.,$`</span>:替换当前行到最后一行</span><br><span class="line">        -   <span class="string">`1,$`</span>: 替换第一行到最后一行,相当于 :%s</span><br><span class="line"></span><br><span class="line">    -   <span class="string">`s`</span>:替换</span><br><span class="line">    -   <span class="string">`key`</span>:</span><br><span class="line">        -   特殊字符用\转义:将<span class="string">`&quot;123\\&quot;`</span> 替换成 <span class="string">`&#x27;123//&#x27;`</span> 的指令为<span class="string">`:s/\&quot;123\/\/\&quot;/\&#x27;123\\\\\&#x27;/g`</span></span><br><span class="line">    -   <span class="string">`newkey`</span></span><br><span class="line">    -   <span class="string">`option`</span>: -<span class="string">`g`</span>:全局 -<span class="string">`c`</span>:确认 -<span class="string">`p`</span>:结果逐行显示 -<span class="string">`/gcp`</span>:组合写法</span><br></pre></td></tr></table></figure>
<h3 id="撤销、反撤销"><a href="#撤销、反撤销" class="headerlink" title="撤销、反撤销"></a>撤销、反撤销</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">-   <span class="string">`u、ctrl+r`</span></span><br></pre></td></tr></table></figure>
<h3 id="缩进"><a href="#缩进" class="headerlink" title="缩进"></a>缩进</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">-   <span class="string">`&gt;&gt;`</span></span><br><span class="line">-   <span class="string">`3&gt;&gt;`</span></span><br><span class="line">-   选择代码 + =号:自动缩进</span><br><span class="line">-   设置缩进长度 :set shiftwidth=n</span><br></pre></td></tr></table></figure>
<h3 id="文件操作"><a href="#文件操作" class="headerlink" title="文件操作"></a>文件操作</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line">-   直接打开新文件</span><br><span class="line">    -   <span class="string">`:e filepath`</span></span><br><span class="line">    -   <span class="string">`:e`</span>:刷新当前文件</span><br><span class="line">    -   <span class="string">`:tabe xxx,:e filepath`</span>:新建 tab 页再打开文件</span><br><span class="line">    -   <span class="string">`gt|gT`</span>:切换 tab 页</span><br><span class="line">    -   <span class="string">`vim -p files`</span>:通过 tab 页方式打开多个文件</span><br><span class="line">-   从外部读取内容 到文件中</span><br><span class="line">    -   <span class="string">`:read !cat file`</span></span><br><span class="line">    -   <span class="string">`:read !ascii`</span></span><br><span class="line">-   多文件操作</span><br><span class="line">    - vim <span class="string">`file file2 filee ...`</span></span><br><span class="line">    - vim $(grep xxx -rl ./)  查到多个文件直接打开</span><br><span class="line">    - <span class="string">`:ls`</span>:查看当前窗口文件列表以及<span class="string">`编号`</span></span><br><span class="line">    - <span class="string">`C+6 或 e#`</span>:回到前一个打开的文件</span><br><span class="line">    - <span class="string">`n C+6`</span>:直接切换到第<span class="string">`编号为`</span>n的文件（先按编号 再按<span class="title class_">Ctrl</span>+<span class="number">6</span> 跳转）</span><br><span class="line">    - <span class="string">`:bn`</span>:下一个文件</span><br><span class="line">    - <span class="string">`:bp`</span>:上一个文件</span><br><span class="line">    - <span class="string">`C+n`</span>:<span class="title class_">PlugInstal</span> 中可以使用</span><br></pre></td></tr></table></figure>
<h3 id="分屏"><a href="#分屏" class="headerlink" title="分屏"></a>分屏</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">-   水平垂直分屏<span class="string">`:new|vnew`</span></span><br><span class="line">    <span class="string">`ctrl+w ,w`</span>:切换窗格</span><br><span class="line">    <span class="string">`ctrl+w ,j`</span>:向下切换</span><br><span class="line">    <span class="string">`ctrl+w ,k`</span>:向上切换</span><br><span class="line">    <span class="string">`ctrl+w ,h`</span>:向左切换</span><br><span class="line">    <span class="string">`ctrl+w ,l`</span>:向右切换</span><br></pre></td></tr></table></figure>
<h3 id="环绕操作"><a href="#环绕操作" class="headerlink" title="环绕操作"></a>环绕操作</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">-   <span class="string">`d s &lt;existing char&gt; 删除两边的指定字符`</span></span><br><span class="line">-   <span class="string">`c s &lt;existing char&gt; &lt;desired char&gt; 修改两边的指定字符`</span></span><br><span class="line">-   <span class="string">`y s &lt;motion&gt; &lt;desired char&gt; 修改两边字符`</span></span><br><span class="line">-   <span class="string">`S &lt;desired char&gt; visual modes 选中指定字符中间的内容`</span></span><br><span class="line">    -   <span class="string">`&quot;test&quot; 输入 cs&quot;&#x27;修改为 &#x27;test&#x27;`</span></span><br><span class="line">    -   <span class="string">`&quot;test&quot; 输入ds&quot; 修改为 test`</span></span><br><span class="line">    -   <span class="string">`&quot;test&quot; 输入 cs&quot;t 123&gt;修改为&lt;123&gt;test&lt;/123&gt;`</span></span><br><span class="line">    -   <span class="string">`test 输入 ysaw) 修改为 (test)`</span></span><br></pre></td></tr></table></figure>
<h3 id="其他"><a href="#其他" class="headerlink" title="其他"></a>其他</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">-   重复上一次操作</span><br><span class="line">    -   小数点<span class="string">` .`</span></span><br><span class="line">-   合并行:或合并选择的行 pacman -R $(pacman -<span class="title class_">Qdtq</span>)</span><br><span class="line">    -   <span class="string">`J`</span></span><br><span class="line">-   编辑模式下 <span class="title class_">Ctrl</span>+w 删除一个单词</span><br><span class="line">-   编辑模式下 <span class="title class_">Ctrl</span>+u 删除到行头</span><br><span class="line">-   <span class="string">`:! ls xxx`</span>:暂时离开做一件事情</span><br><span class="line">-   <span class="string">`:r !ls xxx`</span>:将查到的东西粘贴到文件中</span><br><span class="line">-   <span class="string">`vimtutor zh_zw`</span>:练习</span><br><span class="line">-   <span class="string">`:h xxx`</span>:帮助</span><br></pre></td></tr></table></figure>
<h3 id="宏操作"><a href="#宏操作" class="headerlink" title="宏操作"></a>宏操作</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">-   q+宏名(随便一个字母)</span><br><span class="line">-   操作完成，再按q结束宏录制</span><br><span class="line">-   @宏名使用对应指令</span><br><span class="line">-   <span class="number">9</span>@宏名，使用<span class="number">9</span>次</span><br><span class="line">-   或:指令模式下<span class="string">`:%normal! @d`</span> %每一行,normal模式下 使用宏d</span><br><span class="line">-   :<span class="string">&#x27;&lt;,&#x27;</span>&gt; normal @d :可是快,选择的行执行宏(:xxxg/^/ norm @a)</span><br><span class="line">-   :reg 寄存器中查看录制好宏</span><br><span class="line">-   .<span class="property">vimrc</span> <span class="string">`let @a=&quot;:! node %&quot;`</span> 永久保存</span><br></pre></td></tr></table></figure>

<h2 id="词法"><a href="#词法" class="headerlink" title="词法"></a>词法</h2><h3 id="名词"><a href="#名词" class="headerlink" title="名词"></a>名词</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">-   <span class="string">`w:word`</span> 单词</span><br><span class="line">-   <span class="string">`s:sentence`</span> 句子</span><br><span class="line">-   <span class="string">`p:paragraph`</span> 段落</span><br><span class="line">-   <span class="string">`t:tag`</span> 标签</span><br><span class="line">-   <span class="string">`&#x27;`</span>、<span class="string">`&quot;`</span>、<span class="string">`()`</span>、<span class="string">`&#123;&#125;`</span>、<span class="string">`[]`</span></span><br></pre></td></tr></table></figure>
<h3 id="动词"><a href="#动词" class="headerlink" title="动词"></a>动词</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">-   <span class="string">`y:yank`</span>:复制</span><br><span class="line">-   <span class="string">`p:paste`</span>:粘贴</span><br><span class="line">-   <span class="string">`d:delete`</span>:删除</span><br><span class="line">-   <span class="string">`c:change`</span>:修改</span><br><span class="line">-   <span class="string">`v`</span>:选择</span><br></pre></td></tr></table></figure>
<h3 id="范围"><a href="#范围" class="headerlink" title="范围"></a>范围</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">-   <span class="string">`i`</span>:在什么什么之内</span><br><span class="line">-   <span class="string">`a`</span></span><br></pre></td></tr></table></figure>
<h3 id="量词"><a href="#量词" class="headerlink" title="量词"></a>量词</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">-   数字</span><br></pre></td></tr></table></figure>
<h3 id="组合"><a href="#组合" class="headerlink" title="组合"></a>组合</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">-   <span class="string">`vis`</span>:选择一句话</span><br><span class="line">-   <span class="string">`vi&quot;`</span>:选择单引号内</span><br><span class="line">-   <span class="string">`v3w`</span></span><br><span class="line">-   <span class="string">`d3w`</span></span><br><span class="line">-   <span class="string">`3dd`</span></span><br><span class="line">-   <span class="string">`....`</span></span><br></pre></td></tr></table></figure>
<h3 id="vscodevim"><a href="#vscodevim" class="headerlink" title="vscodevim"></a>vscodevim</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">-   <span class="string">`gd`</span> - <span class="title class_">Go</span> to definition, 跳转到定义。</span><br><span class="line">-   <span class="string">`gb`</span> - 找出与光标下相同的下一个单词, 并添加一个光标 ，接下来就可以同时修改。</span><br><span class="line">-   <span class="string">`gh`</span> - 等同于将鼠标移至光标所在单词, 方便查看定义以及报错</span><br></pre></td></tr></table></figure>
<h2 id="键盘字符功能"><a href="#键盘字符功能" class="headerlink" title="键盘字符功能"></a>键盘字符功能</h2><h3 id="第二行"><a href="#第二行" class="headerlink" title="第二行"></a>第二行</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">-   <span class="string">`~ or 反点`</span>:<span class="string">`~`</span>大小写转换，<span class="string">`返点`</span>跳转到m设置的标注(<span class="string">&quot;`a&quot;</span>)</span><br><span class="line">-   <span class="string">`!`</span>:ex命令模式下执行外部指令<span class="string">`:!ls`</span>,或强制保存或退出<span class="string">`:wq!`</span></span><br><span class="line">    -   :! sh %   直接执行当前文件</span><br><span class="line">-   <span class="string">`@`</span>:运行宏</span><br><span class="line">-   <span class="string">`#`</span>:上一个索引(?)</span><br><span class="line">-   <span class="string">`$`</span>:行尾</span><br><span class="line">-   <span class="string">`%`</span>:括号匹配(定位到括号的另一边)</span><br><span class="line">-   <span class="string">`^`</span>:行首</span><br><span class="line">-   <span class="string">`&amp;`</span>:(?)</span><br><span class="line">-   <span class="string">`*`</span>:下一个索引(?)</span><br><span class="line">-   <span class="string">`(`</span>:句子首</span><br><span class="line">-   <span class="string">`) or 0`</span>:<span class="string">`)`</span>下一句首,<span class="string">`0`</span>行首</span><br><span class="line">-   <span class="string">`-`</span>:前一行行首</span><br><span class="line">-   <span class="string">`+ or =`</span>:<span class="string">`+`</span>后一行行首，<span class="string">`=`</span>自动格式化</span><br></pre></td></tr></table></figure>
<h3 id="第三行"><a href="#第三行" class="headerlink" title="第三行"></a>第三行</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">-   <span class="string">`Q or q`</span>:<span class="string">`Q`</span>切换ex模式，<span class="string">`q`</span>录制宏(qa)</span><br><span class="line">-   <span class="string">`W or w`</span>:都是跳转下一个单词<span class="string">`词头`</span></span><br><span class="line">-   <span class="string">`E or e`</span>:都是跳转下一个单词<span class="string">`词尾`</span></span><br><span class="line">-   <span class="string">`R or r`</span>:<span class="string">`R`</span>进入单字符修改模式(否则修改多个每次都要先按r),<span class="string">`r`</span>单字符修改</span><br><span class="line">-   <span class="string">`T or t`</span>:(?)</span><br><span class="line">-   <span class="string">`Y or y`</span>:<span class="string">`Y`</span>拷贝行，<span class="string">`y`</span>拷贝,灵活组合使用</span><br><span class="line">-   <span class="string">`U or u`</span>:<span class="string">`U`</span>撤销光标所在行内命令，<span class="string">`u`</span>撤销命令</span><br><span class="line">-   <span class="string">`I or i`</span>:<span class="string">`I`</span>进入插入模式并定位到行首,<span class="string">`i`</span>进入插入模式定位到当前字符前</span><br><span class="line">-   <span class="string">`O or o`</span>:<span class="string">`O`</span>进入插入模式并分段定位前一行,<span class="string">`o`</span>进入插入模式并分段定位下一行</span><br><span class="line">-   <span class="string">`P or p`</span>:<span class="string">`P`</span>向前粘贴，<span class="string">`p`</span>向后粘贴</span><br><span class="line">-   <span class="string">`&#123; or [`</span>:<span class="string">`&#123;`</span>段首，<span class="string">`[[`</span>文尾(gg)</span><br><span class="line">-   <span class="string">`&#123; or [`</span>:<span class="string">`&#125;`</span>段尾，<span class="string">`]]`</span>文头(G)</span><br></pre></td></tr></table></figure>
<h3 id="第四行"><a href="#第四行" class="headerlink" title="第四行"></a>第四行</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">-   <span class="string">`A or a`</span>:<span class="string">`A`</span>进入插入模式并定位到行尾,<span class="string">`i`</span>进入插入模式定位到当前字符后</span><br><span class="line">-   <span class="string">`S or s`</span>:<span class="string">`S`</span>删除行并进入插入模式，<span class="string">`s`</span>删除字符并进入插入模式</span><br><span class="line">-   <span class="string">`D or d`</span>:<span class="string">`D`</span>删除至行尾，<span class="string">`d`</span>删除功能灵活组合使用</span><br><span class="line">-   <span class="string">`F or f`</span>:<span class="string">`F`</span>单字符反向查找，<span class="string">`f`</span>单字符正向查找(f,输入要查找的字符,f/F上一个下一个)</span><br><span class="line">-   <span class="string">`G or g`</span>:G,gg,ngg，行跳转灵活组合使用</span><br><span class="line">-   <span class="string">`H or h`</span>:<span class="string">`H`</span>屏幕顶行，<span class="string">`h`</span>左箭头</span><br><span class="line">-   <span class="string">`J or j`</span>:<span class="string">`J`</span>合并两行，<span class="string">`j`</span>下箭头</span><br><span class="line">-   <span class="string">`K or k`</span>:<span class="string">`K`</span>帮助文档，<span class="string">`k`</span>上箭头</span><br><span class="line">-   <span class="string">`L or l`</span>:<span class="string">`L`</span>屏幕底行，<span class="string">`l`</span>右箭头</span><br><span class="line">-   <span class="string">`: or ;`</span>:<span class="string">`:`</span>ex模式，<span class="string">`;`</span>重复t/T/f/F</span><br><span class="line">-   <span class="string">`&quot; or &#x27;`</span>：<span class="string">`&quot;`</span>寄存器，<span class="string">`&quot;ayy`</span>设置寄存器a，作用是yy,通过<span class="string">`:reg`</span>查看， <span class="string">`&#x27;`</span>(?)</span><br><span class="line">-   <span class="string">`| or \`:`</span>|<span class="string">`行首，`</span>\<span class="string">`未用</span></span><br></pre></td></tr></table></figure>
<h3 id="第五行"><a href="#第五行" class="headerlink" title="第五行"></a>第五行</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">-   <span class="string">`Z or z`</span>:<span class="string">`Z`</span>(?),<span class="string">`zz`</span>如果行数足够，能将当前干定位到屏幕中间</span><br><span class="line">-   <span class="string">`X or x`</span>:<span class="string">`X`</span>退格删除字符,<span class="string">`x`</span>删除光标所在一个字符      </span><br><span class="line">-   <span class="string">`C or c`</span>:<span class="string">`C`</span>修改至行尾,<span class="string">`c`</span>修改，灵活结合使用</span><br><span class="line">-   <span class="string">`V or v`</span>:<span class="string">`V`</span>可视模式，单位行，<span class="string">`v`</span>:可视模式,单位个，灵活结合使用</span><br><span class="line">-   <span class="string">`B or b`</span>:<span class="string">`B`</span>前一个单词，首字符（空格分）,<span class="string">`b`</span>前一个单词首字符,首字符（特殊符号）</span><br><span class="line">-   <span class="string">`N or b`</span>:<span class="string">`N`</span>查找上一处，<span class="string">`n`</span>查找下一处</span><br><span class="line">-   <span class="string">`M or m`</span>:<span class="string">`M`</span>到屏幕中间行,<span class="string">`m`</span>设置标注(ma),通过返点a定位</span><br><span class="line">-   <span class="string">`&lt; or ,`</span>:<span class="string">`&lt;`</span>两下反缩进，<span class="string">`,`</span>反向t/T/f/<span class="title function_">F</span>(作为 leader键使用)</span><br><span class="line">-   <span class="string">`&gt; or .`</span>:<span class="string">`&gt;`</span>按两下缩进，<span class="string">`.`</span>重复上一次操作</span><br><span class="line">-   <span class="string">`? or /`</span>:<span class="string">`?`</span>向前搜索，<span class="string">`/`</span>向后搜索</span><br></pre></td></tr></table></figure>

<h2 id="nano"><a href="#nano" class="headerlink" title="nano"></a>nano</h2><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">-   保存 <span class="string">`ctrl + o`</span></span><br><span class="line">-   退出 <span class="string">`ctrl + x`</span></span><br></pre></td></tr></table></figure>

<h3 id="换行符号"><a href="#换行符号" class="headerlink" title="换行符号"></a>换行符号</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">set ff=unix ，就是告诉 vi 编辑器，使用unix换行符(linux,\n)</span><br><span class="line">set ff=dos ，就是告诉 vi 编辑器，使用dos换行符(win,\n\r)</span><br><span class="line"></span><br><span class="line">win 比 linux 多了\r</span><br></pre></td></tr></table></figure>

</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="http://example.com">lzoxun</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="http://example.com/2023/07/22/linux/linux-vim/">http://example.com/2023/07/22/linux/linux-vim/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="http://example.com" target="_blank">学习笔记</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"></div><div class="post_share"><div class="social-share" data-image="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/2023/07/22/linux/linux-shell/" title="shell"><div class="cover" style="background: var(--default-bg-color)"></div><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">shell</div></div></a></div><div class="next-post pull-right"><a href="/2023/07/22/linux/linux-vimrc/" title="vimrc"><div class="cover" style="background: var(--default-bg-color)"></div><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">vimrc</div></div></a></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src= "" data-lazy-src="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">lzoxun</div><div class="author-info__description"></div></div><div class="card-info-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">108</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">1</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">0</div></a></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/liaozhongxun"><i class="fab fa-github"></i><span>Follow Me</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/liaozhongxun" target="_blank" title="Github"><i class="fab fa-github" style="color: #24292e;"></i></a><a class="social-icon" href="mailto:869664233@gmail.com" target="_blank" title="Email"><i class="fas fa-envelope" style="color: #4a7dbe;"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content">这是我的文档</div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%9F%BA%E7%A1%80%E6%93%8D%E4%BD%9C"><span class="toc-number">1.</span> <span class="toc-text">基础操作</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%A8%A1%E5%BC%8F"><span class="toc-number">1.1.</span> <span class="toc-text">模式</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E7%A7%BB%E5%8A%A8"><span class="toc-number">1.2.</span> <span class="toc-text">移动</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%8A%98%E8%A1%8C"><span class="toc-number">1.3.</span> <span class="toc-text">折行</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%90%9C%E7%B4%A2"><span class="toc-number">1.4.</span> <span class="toc-text">搜索</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%A4%8D%E5%88%B6%E3%80%81%E7%B2%98%E8%B4%B4"><span class="toc-number">1.5.</span> <span class="toc-text">复制、粘贴</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%88%A0%E9%99%A4"><span class="toc-number">1.6.</span> <span class="toc-text">删除</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%9B%BF%E6%8D%A2"><span class="toc-number">1.7.</span> <span class="toc-text">替换</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%92%A4%E9%94%80%E3%80%81%E5%8F%8D%E6%92%A4%E9%94%80"><span class="toc-number">1.8.</span> <span class="toc-text">撤销、反撤销</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E7%BC%A9%E8%BF%9B"><span class="toc-number">1.9.</span> <span class="toc-text">缩进</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%96%87%E4%BB%B6%E6%93%8D%E4%BD%9C"><span class="toc-number">1.10.</span> <span class="toc-text">文件操作</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%88%86%E5%B1%8F"><span class="toc-number">1.11.</span> <span class="toc-text">分屏</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E7%8E%AF%E7%BB%95%E6%93%8D%E4%BD%9C"><span class="toc-number">1.12.</span> <span class="toc-text">环绕操作</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%85%B6%E4%BB%96"><span class="toc-number">1.13.</span> <span class="toc-text">其他</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%AE%8F%E6%93%8D%E4%BD%9C"><span class="toc-number">1.14.</span> <span class="toc-text">宏操作</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E8%AF%8D%E6%B3%95"><span class="toc-number">2.</span> <span class="toc-text">词法</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%90%8D%E8%AF%8D"><span class="toc-number">2.1.</span> <span class="toc-text">名词</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%8A%A8%E8%AF%8D"><span class="toc-number">2.2.</span> <span class="toc-text">动词</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E8%8C%83%E5%9B%B4"><span class="toc-number">2.3.</span> <span class="toc-text">范围</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E9%87%8F%E8%AF%8D"><span class="toc-number">2.4.</span> <span class="toc-text">量词</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E7%BB%84%E5%90%88"><span class="toc-number">2.5.</span> <span class="toc-text">组合</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#vscodevim"><span class="toc-number">2.6.</span> <span class="toc-text">vscodevim</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E9%94%AE%E7%9B%98%E5%AD%97%E7%AC%A6%E5%8A%9F%E8%83%BD"><span class="toc-number">3.</span> <span class="toc-text">键盘字符功能</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E7%AC%AC%E4%BA%8C%E8%A1%8C"><span class="toc-number">3.1.</span> <span class="toc-text">第二行</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E7%AC%AC%E4%B8%89%E8%A1%8C"><span class="toc-number">3.2.</span> <span class="toc-text">第三行</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E7%AC%AC%E5%9B%9B%E8%A1%8C"><span class="toc-number">3.3.</span> <span class="toc-text">第四行</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E7%AC%AC%E4%BA%94%E8%A1%8C"><span class="toc-number">3.4.</span> <span class="toc-text">第五行</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#nano"><span class="toc-number">4.</span> <span class="toc-text">nano</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%8D%A2%E8%A1%8C%E7%AC%A6%E5%8F%B7"><span class="toc-number">4.1.</span> <span class="toc-text">换行符号</span></a></li></ol></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2023/07/22/window/win-11/" title="win 11 set">win 11 set</a><time datetime="2023-07-22T07:14:09.700Z" title="发表于 2023-07-22 15:14:09">2023-07-22</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2023/07/22/window/win-gitbash/" title="git bash">git bash</a><time datetime="2023-07-22T07:14:09.700Z" title="发表于 2023-07-22 15:14:09">2023-07-22</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2023/07/22/window/win-wsl/" title="wsl">wsl</a><time datetime="2023-07-22T07:14:09.700Z" title="发表于 2023-07-22 15:14:09">2023-07-22</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2023/07/22/window/win-main/" title="window">window</a><time datetime="2023-07-22T07:14:09.700Z" title="发表于 2023-07-22 15:14:09">2023-07-22</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2023/07/22/web/%E5%85%BC%E5%AE%B9%E9%97%AE%E9%A2%98/" title="兼容问题">兼容问题</a><time datetime="2023-07-22T07:14:09.699Z" title="发表于 2023-07-22 15:14:09">2023-07-22</time></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2023 By lzoxun</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="translateLink" type="button" title="简繁转换">繁</button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><button id="go-up" type="button" title="回到顶部"><span class="scroll-percent"></span><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="/js/tw_cn.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox/fancybox.umd.min.js"></script><script src="https://cdn.jsdelivr.net/npm/instant.page/instantpage.min.js" type="module"></script><script src="https://cdn.jsdelivr.net/npm/vanilla-lazyload/dist/lazyload.iife.min.js"></script><script src="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.js"></script><script>function panguFn () {
  if (typeof pangu === 'object') pangu.autoSpacingPage()
  else {
    getScript('https://cdn.jsdelivr.net/npm/pangu/dist/browser/pangu.min.js')
      .then(() => {
        pangu.autoSpacingPage()
      })
  }
}

function panguInit () {
  if (false){
    GLOBAL_CONFIG_SITE.isPost && panguFn()
  } else {
    panguFn()
  }
}

document.addEventListener('DOMContentLoaded', panguInit)</script><div class="js-pjax"></div><script id="canvas_nest" defer="defer" color="0,0,255" opacity="0.7" zIndex="-1" count="99" mobile="false" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/dist/canvas-nest.min.js"></script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script><div id="local-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">搜索</span><span id="loading-status"></span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="is-center" id="loading-database"><i class="fas fa-spinner fa-pulse"></i><span>  数据库加载中</span></div><div class="search-wrap"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div><hr/><div class="no-result" id="local-search-results"></div><div id="local-search-stats-wrap"></div></div></div><div id="search-mask"></div><script src="/js/search/local-search.js"></script></div></div><script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"pluginRootPath":"live2dw/","pluginJsPath":"lib/","pluginModelPath":"assets/","tagMode":false,"log":false,"model":{"jsonPath":"/live2dw/assets/haruto.model.json"},"display":{"position":"right","width":100,"height":200,"right":300},"mobile":{"show":true}});</script></body></html>